﻿@model IEnumerable<Qu.ComputingContest.Model.ScoreSummary>
 
    
<table class="stripe" width="100%" style="font-size:larger">
    <tr>
        <th>
            Rank
        </th>
        <th>
            Team
        </th>
        <th>
           School
        </th>
        @if (ViewBag.IsScoreBoard != null && !ViewBag.IsScoreBoard)
        {
            <th>
               Mentor
            </th>
        
            <th>
               Students
            </th>
        }
        <th>
           Trial
        </th>

        @if (ViewBag.IsScoreBoard != null && !ViewBag.IsScoreBoard)
        {
            <th>
                RunTime
            </th>
            <th>
                Bonuses
            </th>
            <th>
                Penalties
            </th>
        }
        <th>
            Score
        </th>
        @if (ViewBag.IsScoreBoard != null && !ViewBag.IsScoreBoard)
        {
             <th></th>
        }
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            <b>@Html.DisplayFor(modelItem => item.Rank)</b>
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TeamNo)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.School)
        </td>

        @if (ViewBag.IsScoreBoard != null && !ViewBag.IsScoreBoard)
        {
            <td>
                @Html.DisplayFor(modelItem => item.Mentor)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Students)
            </td>
        }
        <td>
            @Html.DisplayFor(modelItem => item.TrialID)
        </td>

        @if (ViewBag.IsScoreBoard != null && !ViewBag.IsScoreBoard)
        {
            <td align="center">
                @Html.Raw(String.Format("{0:0,0.00}", item.RunTime))
            </td>
            <td align="center">
                 @Html.DisplayFor(modelItem => item.Bonuses)
            </td>
            <td align="center">
                @Html.DisplayFor(modelItem => item.Penalties)
            </td>
        }
        
        <td align="right">
            <b>@Html.Raw(String.Format("{0:0,0.00}", item.Score))</b>
        </td>
        @if (!ViewBag.IsScoreBoard)
        {
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.ScoreID }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.ScoreID })
            </td>
        }
    </tr>
}

</table>